import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

/** ************************************************************************************************
 ***************************************** 综合业务 ************************************************
 **************************************************************************************************/
// 公共信息查询
import PublicInfo from '@/views/publicInfo/PublicInfo'
import OpenBankInquiry from '@/views/publicInfo/openBankInquiry/openBankInquiry'

// 挂失
import ReportLoss from '@/views/reportLoss/ReportLoss'
import OralLoss from '@/views/reportLoss/lossModule/OralLoss'

// 个人业务
import Personal from '@/views/personal/Personal'
import Cheque from '@/views/personal/cheque/cheque'
import LoanBusiness from '@/views/personal/loanBusiness/LoanBusiness'
import ShortMessage from '@/views/personal/shortMessage/ShortMessage'
// 公司业务
import Company from '@/views/company/Company'

// 公用路由组件
import Option from '@/views/data/option'
import BussDetail from '@/views/data/bussDetail'

// 线下还款
import RepaymentOffline from '@/views/data/repaymentOffline'
// 还款计划
import RepaymentPlan from '@/views/data/repaymentPlan'
//交易流水查询
import TransactionFlowQuery from '@/views/data/transactionFlowQuery'
//自营和非自营产品展示
import LoanData from '@/views/data/loanData'
//客户信息修改
import CustomerInfoUpdate from '@/views/data/customerInfoUpdate'
import CustomerInfoUpdateTable from '@/views/data/customerInfoUpdateTable'
import CancelQuota from '@/views/data/cancelQuota'

/** ************************************************************************************************
 ***************************************** 信用卡业务 **********************************************
 **************************************************************************************************/
// 待开发

/** ************************************************************************************************
 ***************************************** 视频业务-小程序 *****************************************
 **************************************************************************************************/
// 银行卡激活
import CardActive from '@/views/videoBiz/xiaochengxu/cardActive/CardActive'
// 不动户恢复
import RealEstateRecovery from '@/views/videoBiz/xiaochengxu/realEstateRecovery/RealEstateRecovery'
// 账户限制解除
import AccRestrictLift from '@/views/videoBiz/xiaochengxu/accRestrictLift/AccRestrictLift'
// 对公开户
import ForOpenHouse from '@/views/videoBiz/xiaochengxu/forOpenHouse/ForOpenHouse'

/** ************************************************************************************************
 ***************************************** 视频业务-手机银行 ***************************************
 **************************************************************************************************/
// 银行卡激活
import PhoneBankCardActive from '@/views/videoBiz/phoneBank/cardActive'
// 对公开户
import PhoneBankForOpenHouse from '@/views/videoBiz/phoneBank/forOpenHouse'
// 理财风险评估
import PhoneBankRiskAssessment from '@/views/videoBiz/phoneBank/riskAssessment'

/** ************************************************************************************************
 ******************************************* 知识库 ************************************************
 **************************************************************************************************/
// 知识库组件
import Kbp from '@/views/kbp/kbp'
import KbpDetail from '@/views/kbp/kbpDetail'
import KbpArticleAdd from '@/views/kbp/articleAdd'
import KbpQuestionAdd from '@/views/kbp/questionAdd'

/** ************************************************************************************************
 ***************************************** 智能推荐 ************************************************
 **************************************************************************************************/
// import FaceRecognition from '@/views/faceRecognition/FaceRecognition'

/** ************************************************************************************************
 ***************************************** 智能助手 ************************************************
 **************************************************************************************************/
// import IntelligentAssisTant from '@/views/intelligentAssisTant/IntelligentAssisTant'
/** ************************************************************************************************
 ***************************************** 网页协同 ************************************************
 **************************************************************************************************/
// import WebCollaborative from '@/views/webCollaborative/WebCollaborative'
/** ************************************************************************************************
 ***************************************** 人脸识别 ************************************************
 **************************************************************************************************/
// import FaceRecognition from '@/views/faceRecognition/FaceRecognition'

export default new Router({
  routes: [
    {
      // 首先进行重定向操作
      path: '/',
      redirect: { name: window.ctpMenuOption.home.redirectName }
    },
    /** *************************************** 综合业务 ***********************************************/
    // 个人业务
    {
      path: '/personal',
      name: 'personal',
      component: Personal,
      meta: {
        keepAlive: true,
        ifDoFresh: false,
        active: '/personal',
        isBack: false
      },
      children: [
        {
          path: 'customeBuss',
          name: 'customeBuss',
          component: Option,
          meta: {
            aliasName: '业务信息',
            keepAlive: true,
            active: '/personal',
            isBack: true,
            flag: 'customeBuss',
            // 是否需要验密
            needAuth: true,
            // 离线是否可操作
            needOnline: true,
            type: ['table']
          }
        },
        {
          path: 'bussDetail',
          name: 'bussDetail',
          component: BussDetail,
          meta: {
            aliasName: '业务信息详情',
            keepAlive: true,
            active: '/personal',
            isBack: true,
            flag: 'bussDetail',
            // 是否需要验密
            needAuth: true,
            // 离线是否可操作
            needOnline: true,
            type: ['tabs']
          }
        },
        {
          path: 'unBussDetail',
          name: 'unBussDetail',
          component: BussDetail,
          meta: {
            aliasName: '业务信息详情',
            keepAlive: true,
            active: '/personal',
            isBack: true,
            flag: 'unBussDetail',
            // 是否需要验密
            needAuth: true,
            // 离线是否可操作
            needOnline: true,
            type: ['tabs']
          }
        },
        {
          path: 'cheque',
          name: 'cheque',
          component: Cheque,
          meta: {
            aliasName: '签约查询',
            keepAlive: true,
            active: '/personal',
            isBack: true,
            flag: 'cheque',
            // 是否需要验密
            needAuth: true,
            // 离线是否可操作
            needOnline: true,
            type: ['default']
          }
        },
        {
          path: 'loanBusiness',
          name: 'loanBusiness',
          component: LoanBusiness,
          meta: {
            aliasName: '贷款查询',
            keepAlive: true,
            active: '/personal',
            isBack: true,
            flag: 'loanBusiness',
            // 是否需要验密
            needAuth: true,
            // 离线是否可操作
            needOnline: true,
            type: ['tabs']
          }
        },
        {
          path: 'messageService',
          name: 'messageService',
          component: Option,
          meta: {
            aliasName: '短信银行业务',
            keepAlive: true,
            active: '/personal',
            isBack: true,
            flag: 'messageService',
            // 是否需要验密
            needAuth: true,
            // 离线是否可操作
            needOnline: true,
            type: ['tabs']
          }
        }, {
          path: 'passUpdate',
          name: 'passUpdate',
          component: Option,
          meta: {
            aliasName: '查询密码修改',
            keepAlive: true,
            active: '/personal',
            isBack: true,
            flag: 'passUpdate',
            // 是否需要验密
            needAuth: true,
            // 离线是否可操作
            needOnline: true,
            type: ['tabs']
          }
        }, {
          path: 'personalWealth',
          name: 'personalWealth',
          component: Option,
          meta: {
            aliasName: '个人理财',
            keepAlive: true,
            active: '/personal',
            isBack: true,
            flag: 'personalWealth',
            // 是否需要验密
            needAuth: true,
            // 离线是否可操作
            needOnline: true,
            type: ['tabs']
          }
        }, {
          path: 'sendShortMessage',
          name: 'sendShortMessage',
          component: ShortMessage,
          meta: {
            aliasName: '短消息发送',
            keepAlive: true,
            active: '/personal',
            isBack: true,
            flag: 'sendShortMessage',
            // 是否需要验密
            needAuth: true,
            // 离线是否可操作
            needOnline: true,
            type: ['tabs']
          }
        },
        // 线下还款业务
        {
          path: 'repaymentOffline',
          name: 'repaymentOffline',
          component: RepaymentOffline,
          meta: {
            aliasName: '线下还款业务',
            keepAlive: true,
            active: '/personal',
            isBack: true,
            flag: 'repaymentOffline',
            // 是否需要验密
            needAuth: true,
            // 离线是否可操作
            needOnline: true,
            type: ['tabs']
          },
          children: [{
            path: '/repaymentPlan/:data', // 使用动态路由参数来传递借据信息的唯一标识
            name: 'RepaymentPlan',
            component: RepaymentPlan
          }]
        },
        //额度注销业务
        {
          path: 'cancelQuota',
          name: 'cancelQuota',
          component: CancelQuota,
          meta: {
            aliasName: '额度注销',
            keepAlive: true,
            active: '/personal',
            isBack: true,
            flag: 'cancelQuota',
            // 是否需要验密
            needAuth: false,
            // 离线是否可操作
            needOnline: true,
            type: ['tabs']
          },
        },
        //交易流水查询业务
        {
          path: 'transactionFlowQuery',
          name: 'transactionFlowQuery',
          component: TransactionFlowQuery,
          meta: {
            aliasName: '交易流水查询业务',
            keepAlive: true,
            active: '/personal',
            isBack: true,
            flag: 'transactionFlowQuery',
            // 是否需要验密
            needAuth: false,
            // 离线是否可操作
            needOnline: true,
            type: ['tabs']
          },
        },
        {
          path: 'loanData',
          name: 'loanData',
          component: LoanData,
          meta: {
            aliasName: '借据信息展示',
            keepAlive: true,
            active: '/personal',
            isBack: true,
            flag: 'loanData',
            // 是否需要验密
            needAuth: false,
            // 离线是否可操作
            needOnline: true,
            type: ['tabs']
          },
        },
        {
          path: 'customerInfoUpdate',
          name: 'customerInfoUpdate',
          component: CustomerInfoUpdate,
          meta: {
            aliasName: '客户信息修改',
            keepAlive: true,
            active: '/personal',
            isBack: true,
            flag: 'customerInfoUpdate',
            // 是否需要验密
            needAuth: false,
            // 离线是否可操作
            needOnline: true,
            type: ['tabs'],
            show: true
          },
          query: {}
        },
        {
          path: 'customerInfoUpdateTable',
          name: 'customerInfoUpdateTable',
          component: CustomerInfoUpdateTable,
          meta: {
            aliasName: '客户修改记录',
            keepAlive: true,
            active: '/personal',
            isBack: true,
            flag: 'customerInfoUpdateTable',
            // 是否需要验密
            needAuth: false,
            // 离线是否可操作
            needOnline: false,
            type: ['tabs'],
          },
        }

      ]
    },

    // 公司业务
    {
      path: '/company',
      name: 'company',
      component: Company,
      meta: {
        keepAlive: true,
        ifDoFresh: false,
        active: '/company',
        isBack: false
      },
      children: [
        {
          path: 'accInfo',
          name: 'accInfo',
          component: Option,
          meta: {
            aliasName: '账户查询',
            keepAlive: true,
            active: '/company',
            isBack: true,
            flag: 'accInfo',
            // 是否需要验密
            needAuth: true,
            // 离线是否可操作
            needOnline: true,
            type: ['tabs']
          }
        }
      ]
    },
    // 公共信息
    {
      path: '/publicInfo',
      name: 'publicInfo',
      component: PublicInfo,
      meta: {
        active: '/publicInfo',
        isBack: false,
        keepAlive: true
      },
      children: [
        {
          path: 'depositInterestRateInquiry',
          name: 'depositInterestRateInquiry',
          component: Option,
          meta: {
            aliasName: '存款利率查询',
            keepAlive: true,
            active: '/publicInfo',
            isBack: true,
            flag: 'depositInterestRateInquiry',
            type: ['table']
          }
        },
        {
          path: 'exchangeRateInquiry',
          name: 'exchangeRateInquiry',
          component: Option,
          meta: {
            aliasName: '汇率查询',
            keepAlive: true,
            active: '/publicInfo',
            isBack: true,
            flag: 'exchangeRateInquiry',
            type: ['table']
          }
        },
        {
          path: 'personalProductSupermarket',
          name: 'personalProductSupermarket',
          component: Option,
          meta: {
            aliasName: '个人理财产品',
            keepAlive: true,
            active: '/publicInfo',
            isBack: true,
            flag: 'personalProductSupermarket',
            type: ['table']
          }
        },
        {
          path: 'wealthProductSupermarket',
          name: 'wealthProductSupermarket',
          component: Option,
          meta: {
            aliasName: '理财产品超市',
            keepAlive: true,
            active: '/publicInfo',
            isBack: true,
            flag: 'wealthProductSupermarket',
            type: ['table']
          }
        },
        {
          path: 'loanInterestRateInquiry',
          name: 'loanInterestRateInquiry',
          component: Option,
          meta: {
            aliasName: '贷款利率查询',
            keepAlive: true,
            active: '/publicInfo',
            isBack: true,
            flag: 'loanInterestRateInquiry',
            type: ['table']
          }
        },
        {
          path: 'openBankInquiry',
          name: 'openBankInquiry',
          component: OpenBankInquiry,
          meta: {
            aliasName: '开户行查询',
            keepAlive: true,
            active: '/publicInfo',
            isBack: true,
            flag: 'openBankInquiry',
            type: ['table']
          }
        },
        {
          path: 'fundProductSupermarket',
          name: 'fundProductSupermarket',
          component: Option,
          meta: {
            aliasName: '基金产品超市',
            keepAlive: true,
            active: '/publicInfo',
            isBack: true,
            flag: 'fundProductSupermarket',
            type: ['table']
          }
        }
      ]
    },
    // 挂失
    {
      path: '/reportLoss',
      name: 'reportLoss',
      component: ReportLoss,
      meta: {
        keepAlive: true,
        ifDoFresh: false,
        active: '/reportLoss',
        isBack: false
      },
      children: [
        {
          path: 'oralLoss',
          name: 'oralLoss',
          component: OralLoss,
          meta: {
            aliasName: '口头挂失',
            keepAlive: true,
            active: '/reportLoss',
            isBack: true,
            flag: 'oralLoss',
            type: ['']
          }
        }
      ]
    },
    /** *************************************** 视频业务 ***********************************************/
    {
      path: '/cardActive',
      name: 'cardActive',
      components: {
        videoServices: CardActive
      },
      meta: {
        keepAlive: true,
        active: '/cardActive',
        isBack: false,
        flag: 'CardActive'
      }
    },
    {
      path: '/realEstateRecovery',
      name: 'realEstateRecovery',
      components: {
        videoServices: RealEstateRecovery
      },
      meta: {
        keepAlive: true,
        active: '/realEstateRecovery',
        isBack: false,
        flag: 'RealEstateRecovery'
      }
    },
    {
      path: '/accRestrictLift',
      name: 'accRestrictLift',
      components: {
        videoServices: AccRestrictLift
      },
      meta: {
        keepAlive: true,
        active: '/accRestrictLift',
        isBack: false,
        flag: 'AccRestrictLift'
      }
    },
    {
      path: '/forOpenHouse',
      name: 'forOpenHouse',
      components: {
        videoServices: ForOpenHouse
      },
      meta: {
        keepAlive: true,
        active: '/forOpenHouse',
        isBack: false,
        flag: 'ForOpenHouse'
      }
    },
    {
      path: '/phoneBankCardActive',
      name: 'phoneBankCardActive',
      components: {
        videoServices: PhoneBankCardActive
      },
      meta: {
        keepAlive: true,
        active: '/phoneBankCardActive',
        isBack: false,
        flag: 'phoneBankCardActive'
      }
    },
    {
      path: '/phoneBankForOpenHouse',
      name: 'phoneBankForOpenHouse',
      components: {
        videoServices: PhoneBankForOpenHouse
      },
      meta: {
        keepAlive: true,
        active: '/phoneBankForOpenHouse',
        isBack: false,
        flag: 'phoneBankForOpenHouse'
      }
    },
    {
      path: '/phoneBankRiskAssessment',
      name: 'phoneBankRiskAssessment',
      components: {
        videoServices: PhoneBankRiskAssessment
      },
      meta: {
        keepAlive: true,
        active: '/phoneBankRiskAssessment',
        isBack: false,
        flag: 'phoneBankRiskAssessment'
      }
    },
    /** *************************************** 智能助手 ***********************************************/
    {
      path: '/kbp',
      name: 'kbp',
      components: {
        kbpRouter: Kbp
      },
      meta: {
        keepAlive: true,
        ifDoFresh: true,
        active: '/kbp',
        isBack: true
      }
    },
    {
      path: '/kbpDetail',
      name: 'kbpDetail',
      components: {
        kbpRouter: KbpDetail
      },
      meta: {
        keepAlive: true,
        ifDoFresh: false,
        active: '/kbpDetail',
        isBack: true
      }
    },
    {
      path: '/kbpArticleAdd',
      name: 'kbpArticleAdd',
      components: {
        kbpRouter: KbpArticleAdd
      },
      meta: {
        keepAlive: true,
        ifDoFresh: false,
        active: '/kbpArticleAdd',
        isBack: true
      }
    },
    {
      path: '/kbpQuestionAdd',
      name: 'kbpQuestionAdd',
      components: {
        kbpRouter: KbpQuestionAdd
      },
      meta: {
        keepAlive: true,
        ifDoFresh: false,
        active: '/kbpQuestionAdd',
        isBack: true
      }
    }

    /** *************************************** 智能助手 ***********************************************/
    // {
    //   path: '/intelligentAssisTant',
    //   name: 'intelligentAssisTant',
    //   component: IntelligentAssisTant,
    //   meta: {
    //     keepAlive: true,
    //     ifDoFresh: false,
    //     active: '/intelligentAssisTant',
    //     isBack: true
    //   }
    // },
    /** *************************************** 网页协同 ***********************************************/
    // {
    //   path: '/webCollaborative',
    //   name: 'webCollaborative',
    //   component: WebCollaborative,
    //   meta: {
    //     keepAlive: true,
    //     ifDoFresh: false,
    //     active: '/webCollaborative',
    //     isBack: true
    //   }
    // },
    /** *************************************** 人脸识别 ***********************************************/
    // {
    //   path: '/faceRecognition',
    //   name: 'faceRecognition',
    //   component: FaceRecognition,
    //   meta: {
    //     keepAlive: true,
    //     ifDoFresh: false,
    //     active: '/faceRecognition',
    //     isBack: true
    //   }
    // }
  ]
})
